<template>
	<a-col :xl="{ span: 12 }" :lg="{ span: 12 }" :md="{ span: 12 }">
		<!-- <a-form-item :label="data.fieldAliase" :labelCol="labelCol" :wrapperCol="wrapperCol"> -->
		<a-form-item :label="data.fieldAliase" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="data.fieldCode == 'baseInfoId'">
			<a-select
				v-decorator="[`${data.fieldCode}`, { rules: rules, initialValue: data.defaultValue }]"
				@change="handleChange"
			>
				<a-select-option v-for="item in data.optionList" :key="item.baseInfoId" :value="item.baseInfoId">
					{{ item.name }}
				</a-select-option>
			</a-select>
		</a-form-item>
		

		<a-form-item :label="data.fieldAliase" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="data.fieldCode == 'scenicArea'">
			<a-select
				v-decorator="[`${data.fieldCode}`, { rules: rules, initialValue: data.defaultValue }]"
				@change="handleChange"
			>
				<a-select-option v-for="item in scenicList" :key="item.key" :value="item.name" :label="item.name">
					{{ item.name }}
				</a-select-option>
			</a-select>
		</a-form-item>

		<a-form-item :label="data.fieldAliase" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="data.fieldCode == 'hotelType'">
			<a-select
				v-decorator="[`${data.fieldCode}`, { rules: rules, initialValue: data.defaultValue }]"
				@change="handleChange"
			>
				<a-select-option v-for="item in wineshopList" :key="item.key" :value="item.name" :label="item.name">
					{{ item.name }}
				</a-select-option>
			</a-select>
		</a-form-item>

	</a-col>
</template>
<script>
export default {
	name: 'InputSelect',
	components: {},
	props: {
		form: {
			type: Object,
			required: true,
		},
		data: {
			type: Object,
			required: true,
		},
	},
	data() {
		return {
			labelCol: {
				xs: {
					span: 24,
				},
				sm: {
					span: 3,
				},
			},
			wrapperCol: {
				xs: {
					span: 24,
				},
				sm: {
					span: 20,
				},
			},
			rules: [],
			baseInfoList: [],
			scenicList:[
				{
				name:'无',
				key:0
				},
				{
				name:'防川景区',
				key:1
				},
				{
				name:'珲春市区',
				key:2
				}
			],
			wineshopList:[
				{
				name:'无',
				key:0
				},
				{
				name:'商务型酒店',
				key:1
				},
				{
				name:'经济型酒店',
				key:2
				},
					{
				name:'主题酒店',
				key:3
				},
				{
				name:'连锁酒店',
				key:4
				},
				{
				name:'民宿',
				key:5
				}
			]
		}
	},
	created() {
		this.init()
	},
	methods: {
		init() {
			const data = this.data
			// console.log(data);
			// this.rules = [{ required: data.isRequired, message: '请输入' + data.fieldAliase }]
			// 	this.form.validateFields((err, values) => {
			// 		console.log(values,1111) // { name: '' }
			// })
		},
		handleChange() {
			// console.log(`selected ${value}`)
		},
	}
}
</script>
